package cn.tedu.zblogs.home.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ESConfig {
    private static RestHighLevelClient client;

    static {
        client = new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("47.109.47.227", 9200, "http") // 替换为你的ES服务器地址
                )
        );
    }

    public static RestHighLevelClient getClient() {
        return client;
    }

}
